<%@page import="java.text.SimpleDateFormat"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@page import="wildcard.servlet.LoginBean" import="java.util.ArrayList"%>
<%@ page import="java.util.*" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
		<title>配膳状況</title>
	</head>

	<body>
	<%
		ArrayList<ArrayList<String>> resultList = (ArrayList<ArrayList<String>>) request
				.getAttribute("result");
	%>
		<table border = "1" align= "left">
			<tr>
				<th>
					<%
						Date date = new Date();
						SimpleDateFormat time = new SimpleDateFormat("MM/dd/kk/mm");
					%>
					<%=time.format(date) %>
				</th>
			</tr>
			<tr>
				<th>配膳状況</th>
			</tr>
		</table>
		</br>
		</br>
		</br>
		</br>
		</br>
		<form action= "">
			<input type= "button" value= "メインへ戻る" onClick="location.href='http://localhost:8080/ax0205/android_main.jsp'" />
			<div align= "right"> <input type= "button" value= "更新"> </div>
			</br>
			</br>
			</br>
			<table border= "1" align= "center">
				<tr>
					<th>注文ID</th>
					<th>テーブル名</th>
					<th>品目</th>
					<th>注文時刻</th>
					<th>配膳</th>
				</tr>
					<%
						for (int row = 0; row < resultList.size(); row++) {
						ArrayList<String> record = resultList.get(row);
					%>
				<tr>
					<%
						for(int column = 0; column < record.size(); column++) {
						String data = record.get(column);
					%>
					<% if(row == 0) { %>
						<td align="center">
					<%} else { %>
						<td align="left">
					<% } %>
						<%=data %></td>
					<% } %>
				</tr>
		<% } %>

<%--				<%
				for (int i = 0; i <= resultList.size(); i++) {
					ArrayList<String> record = resultList.get();%>
				<tr>
					<th>order_id <%= i%></th>
					<th>table<%= i%></th>
					<th>menu<%= i%></th>
					<th>order_time<%= i%></th>
					<th>済<input type= "checkbox" name="order_id<%= i%>" value="済"></th>
				</tr>
				<% } %>
			</table>
 --%>			</br>
			</br>
			<div align="right"> <input type="button" value="更新"/> </div>
		</form>
	</body>
</html>ttt